<?php

class Application_Form_Rent extends Application_Form_Offer
{
	public function __construct($options = null)
	{
		parent::__construct($options);
		$this->setName('rent');

		$periodChoice = array('-1' => 'Choice:', '1' => 'Mount', '2' => 'Year');
		$period = new Zend_Form_Element_Select('period');
		$period->setLabel('Period:');
		$period->addMultiOptions($periodChoice);
		$period->class = 'period';
		$period->addValidator(new Zend_Validate_Between(array('min' => 1, 'max' => 2)))
		->addErrorMessage('You need to select one value');
		
		$submit = new Zend_Form_Element_Submit('submit');
		$submit->setAttrib('id', 'submitbutton')
		->setLabel('Add');

		$elements = array($period,$submit);
		$this->addElements($elements);

		$this->setDecorators( array( array('ViewScript', array('viewScript' => 'forms/offerform.phtml'))));
	}
}